home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 43
/
Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso
/
-serious-
/
comms
/
other
/
ftransapiv
/
arexx
/
ftransib.ibrx
< prev
next >
Wrap
Text File
|
1999-06-14
|
3KB
|
119 lines
/*
----------------------------------------
IBrowse Translator By FTranslator Client
Script by Cristian Robert Gallas
Tested with IBrowse 1.22
Usage:
Use in ARexx interface of IBrowse
$VER: FTransIB.ibrx v0.01 (14.08.96)
----------------------------------------
HISTORY
----------------------------------------
v0.01b [14.08.98] - First public beta version.
----------------------------------------
[Steps installation]
> Copy FTransIB.ibrx to IBROWSE:IBrx/
> Go to Preferences/General
> Select folder Rexx
> Click in ADD
> Name -> Port->Eng (Example: Portuguese to English)
> Macro -> IBROWSE:IBrx/FTransIB.ibrx 3 (3 is a translation direction)
> Click OK
> Save preferences in Preferences/Save Settings
> Select text for translation
> Go to REXX Menu and select Port->Eng
> Wait for windows with translation :)
0 - English to Francais
1 - English to Deutsch
2 - English to Italiano
3 - English to Portugues
4 - English to Espanol
5 - Francais to English
6 - Deutsch to English
7 - Italiano to English
8 - Espanol to English
9 - Portugues to English
*/
Options Results
tmpfile = 'Ram:FTransTmp.IB'
tmpclip = 'Ram:FTransIB.Clip'
sel = ''
ARG traduz
/* TESTA SE PODE SER USADAS AS LIBS DO AREXX */
if ~show(l, "rexxsupport.library") then
if ~addlib("rexxsupport.library", 0, -30) then
exit
/* TESTA SE PODE SER USADAS AS LIBS DO AREXX */
if ~show(l, "rexxtricks.library") then
if ~addlib("rexxtricks.library", 0, -30) then
exit
saida = TestaPubScreen(pubscreenlist(screenlist))
/* TESTA SE O PROGRAMA JA NAO ESTA COM A PORTA DE TRADUCAO ABERTA */
if exists(tmpfile) then do
Address Command 'echo "FTranslation port is open! Translation in progress, wait..." > "Ram:FT.echo.tmp"'
if saida = 0 then
Address Command 'Multiview PUBSCREEN IBROWSER "Ram:FT.echo.tmp"'
else
Address Command 'Multiview "Ram:FT.echo.tmp"'
call delete('Ram:FT.echo.tmp')
exit
end
/* COLOCA COMO DEFAULT PORTUGUES TO ENGLISH */
if traduz = "" then
traduz = 3
/* LE O CLIPBOARD */
sel = ReadClipboard(0)
/* TESTA SE FOI MARCADO O TEXTO */
if sel = '' then do
Address Command 'echo "You need select text first..." > 'tmpfile
if saida = 0 then
Address Command 'Multiview PUBSCREEN IBROWSER "'tmpfile'"'
else
Address Command 'Multiview "'tmpfile'"'
call delete(tmpfile)
exit
end
call open(1, tmpclip, 'W')
call writeln(1, sel)
call close(1)
/* EXECUTA O FTRANSLATOR COM OS ARGUMENTOS DA TRADUCAO */
comando = 'C:FTranslator FILE 'traduz' "'tmpclip'" SILENCE > 'tmpfile
Address Command comando
call delete(tmpclip)
if saida = 0 then
Address Command 'Amigaguide PUBSCREEN IBROWSER "'tmpfile'"'
else
Address Command 'Amigaguide "'tmpfile'"'
call delete(tmpfile)
exit
/* TESTA SE O IBROWSER ESTA EM UMA JANELA PUBSCREEN */
TestaPubScreen:
Do i = 1 To screenlist.0
if Lower(screenlist.i) = 'ibrowser' then
return 0
end
return 1